# 04.Pip替换国内镜像

在采用默认 pip3 安装第三方库的时候,经常会出现超时的情况。

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

# 国内的pip源

  • 阿里云:https://mirrors.aliyun.com/pypi/simple/
  • 清华:https://pypi.tuna.tsinghua.edu.cn/simple
  • 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
  • 华中理工大学:http://pypi.hustunique.com/
  • 山东理工大学:http://pypi.sdutlinux.org/
  • 豆瓣:http://pypi.douban.com/simple/

# 临时更换镜像源

pip3 install 库名 -i 镜像地址

# 引用

  1. pip3 替换国内镜像源 (opens new window)
Last Updated: 4/28/2023, 10:08:53 AM
Apache License 2.0 | Copyright © 2022 by xueliang.wu 苏ICP备15016087号